#include <iostream>
#include <mutex>
#include <vector>

class Example {
public:
    Example(std::vector<int> vec) : vec_(vec) {}
    void add_to_list(int value) {
        std::lock_guard guard(mtx_);
        vec_.push_back(value);
    }
    void list_contains(){
        std::lock_guard guard(mtx_);
        for(auto iter = vec_.begin(); iter != vec_.end(); ++iter)
            std::cout << *iter << " ";
        std::cout << "\n";
    }
private:
    std::mutex mtx_;
    std::vector<int> vec_;
};

int main()
{
    Example e1( std::vector<int> {1,2,3});
    return 0;
}